﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Web;
using DHQGHN.DAL;
using DHQGHN.DAL.BO.DanhMuc;
using DHQGHN.DAL.Models.DanhMuc;

namespace DHQGHN.Services.DanhMuc
{
    public class DownloadCatalogService : IDownloadCatalogService
    {
        log4net.ILog logger = log4net.LogManager.GetLogger(typeof(DownloadCatalogService));
        private EducationTrainingBO educationTrainingBO;
        private MaritalStatusBO martialStatusBO;
        private EducationLevelBO educationLevelBO;
        private TechnicalLevelBO technicalLevelBO;
        private BloodGroupBO bloodGroupBO;
        private SeriousDiseaseBO seriousDiseaseBO;
        private DisabilityStatusBO disabilityStatusBO;
        private InsuranceStatusBO insuranceStatusBO;
        private CourtBO courtBO;
        private DeathCauseBO deathCauseBO;

        #region Constructors
        /// <summary>
        /// 
        /// </summary>
        public DownloadCatalogService()
        {                                                       
        }
        #endregion

        #region Service Methods

        public JSONMessageEducationTraining EducationTrainingGetAll()
        {
            try
            {
                JSONMessageEducationTraining json = new JSONMessageEducationTraining();
                educationTrainingBO = new EducationTrainingBO(DHQGHN.DAL.Common.ConnectionUtil.TKTHDS_TDT_CONNECTION_STRING);
                json.EducationTraining = educationTrainingBO.GetAll();
                json.ErrorCode = 200;
                json.ErrorMessage = "Success";
                json.CurrentTime = DHQGHN.Common.Utils.GetCurrentTimeNow();
                return json;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                throw new FaultException<Fault.UnexpectedServiceFault>(
                    new Fault.UnexpectedServiceFault
                    {
                        ErrorMessage = ex.Message,
                        Source = ex.Source,
                        Target = ex.TargetSite.ToString(),
                        StackTrace = ex.StackTrace
                    },
                    new FaultReason(string.Format("{0}", "Service fault exception")));
            }
        }

        public JSONMessageEducationTraining EducationTrainingGetByID(string educationTrainingID)
        {
            JSONMessageEducationTraining json = new JSONMessageEducationTraining();
            try
            {
                if (string.IsNullOrEmpty(educationTrainingID))
                {
                    json.ErrorCode = -1;
                    json.ErrorMessage = "Thiếu tham số";
                }

                else
                {
                    educationTrainingBO = new EducationTrainingBO(DHQGHN.DAL.Common.ConnectionUtil.TKTHDS_TDT_CONNECTION_STRING);
                    EDUCATION_TRAINING educationLV = educationTrainingBO.GetById(educationTrainingID);
                    if (educationLV != null)
                    {
                        json.EducationTraining.Add(educationLV);
                    }
                    json.ErrorCode = 200;
                    json.ErrorMessage = "Success";
                }
                json.CurrentTime = DHQGHN.Common.Utils.GetCurrentTimeNow();
                return json;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                throw new FaultException<Fault.UnexpectedServiceFault>(
                    new Fault.UnexpectedServiceFault
                    {
                        ErrorMessage = ex.Message,
                        Source = ex.Source,
                        Target = ex.TargetSite.ToString(),
                        StackTrace = ex.StackTrace
                    },
                    new FaultReason(string.Format("{0}", "Service fault exception")));
            }
        }

        public JSONMessageMaritalStatus MaritalStatusGetAll()
        {
            try
            {
                martialStatusBO = new MaritalStatusBO(DHQGHN.DAL.Common.ConnectionUtil.TKTHDS_TDT_CONNECTION_STRING);
                JSONMessageMaritalStatus json = new JSONMessageMaritalStatus();
                json.MaritalStatus = martialStatusBO.GetAll();
                json.ErrorCode = 200;
                json.ErrorMessage = "Success";
                json.CurrentTime = DHQGHN.Common.Utils.GetCurrentTimeNow();
                return json;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                throw new FaultException<Fault.UnexpectedServiceFault>(
                    new Fault.UnexpectedServiceFault
                    {
                        ErrorMessage = ex.Message,
                        Source = ex.Source,
                        Target = ex.TargetSite.ToString(),
                        StackTrace = ex.StackTrace
                    },
                    new FaultReason(string.Format("{0}", "Service fault exception")));
            }
        }

        public JSONMessageMaritalStatus MaritalStatusGetByID(string maritalStatusID)
        {
            JSONMessageMaritalStatus json = new JSONMessageMaritalStatus();
            try
            {
                if (string.IsNullOrEmpty(maritalStatusID))
                {
                    json.ErrorCode = -1;
                    json.ErrorMessage = "Thiếu tham số";
                }

                else
                {
                    martialStatusBO = new MaritalStatusBO(DHQGHN.DAL.Common.ConnectionUtil.TKTHDS_TDT_CONNECTION_STRING);
                    MARITAL_STATUS educationLV = martialStatusBO.GetById(maritalStatusID);
                    if (educationLV != null)
                    {
                        json.MaritalStatus.Add(educationLV);
                    }
                    json.ErrorCode = 200;
                    json.ErrorMessage = "Success";
                }
                json.CurrentTime = DHQGHN.Common.Utils.GetCurrentTimeNow();
                return json;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                throw new FaultException<Fault.UnexpectedServiceFault>(
                    new Fault.UnexpectedServiceFault
                    {
                        ErrorMessage = ex.Message,
                        Source = ex.Source,
                        Target = ex.TargetSite.ToString(),
                        StackTrace = ex.StackTrace
                    },
                    new FaultReason(string.Format("{0}", "Service fault exception")));
            }
        }

        public JSONMessageEducationLevel EducationLevelGetAll()
        {
            try
            {
                JSONMessageEducationLevel json = new JSONMessageEducationLevel();
                educationLevelBO = new EducationLevelBO(DHQGHN.DAL.Common.ConnectionUtil.TKTHDS_TDT_CONNECTION_STRING);
                json.EducationLevel = educationLevelBO.GetAll();
                json.ErrorCode = 200;
                json.ErrorMessage = "Success";
                json.CurrentTime = DHQGHN.Common.Utils.GetCurrentTimeNow();
                return json;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                throw new FaultException<Fault.UnexpectedServiceFault>(
                    new Fault.UnexpectedServiceFault
                    {
                        ErrorMessage = ex.Message,
                        Source = ex.Source,
                        Target = ex.TargetSite.ToString(),
                        StackTrace = ex.StackTrace
                    },
                    new FaultReason(string.Format("{0}", "Service fault exception")));
            }
        }

        public JSONMessageEducationLevel EducationLevelGetByID(string ID)
        {
            JSONMessageEducationLevel json = new JSONMessageEducationLevel();
            try
            {              
                if (string.IsNullOrEmpty(ID))
                {
                    json.ErrorCode = -1;
                    json.ErrorMessage = "Thiếu tham số";
                }
              
                else
                {
                    educationLevelBO = new EducationLevelBO(DHQGHN.DAL.Common.ConnectionUtil.TKTHDS_TDT_CONNECTION_STRING);
                    EDUCATION_LEVEL educationLV = educationLevelBO.GetById(ID);
                    if (educationLV != null)
                    {
                        json.EducationLevel.Add(educationLV);
                    }                    
                    json.ErrorCode = 200;
                    json.ErrorMessage = "Success";                   
                }
                json.CurrentTime = DHQGHN.Common.Utils.GetCurrentTimeNow();
                return json;               
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                throw new FaultException<Fault.UnexpectedServiceFault>(
                    new Fault.UnexpectedServiceFault
                    {
                        ErrorMessage = ex.Message,
                        Source = ex.Source,
                        Target = ex.TargetSite.ToString(),
                        StackTrace = ex.StackTrace
                    },
                    new FaultReason(string.Format("{0}", "Service fault exception")));
            }
        }

        public JSONMessageTechnicalLevel TechnicalLevelGetAll()
        {
            try
            {
                JSONMessageTechnicalLevel json = new JSONMessageTechnicalLevel();
                technicalLevelBO = new TechnicalLevelBO(DHQGHN.DAL.Common.ConnectionUtil.TKTHDS_TDT_CONNECTION_STRING);
                json.TechnicalLevel = technicalLevelBO.GetAll();
                json.ErrorCode = 200;
                json.ErrorMessage = "Success";
                json.CurrentTime = DHQGHN.Common.Utils.GetCurrentTimeNow();
                return json;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                throw new FaultException<Fault.UnexpectedServiceFault>(
                    new Fault.UnexpectedServiceFault
                    {
                        ErrorMessage = ex.Message,
                        Source = ex.Source,
                        Target = ex.TargetSite.ToString(),
                        StackTrace = ex.StackTrace
                    },
                    new FaultReason(string.Format("{0}", "Service fault exception")));
            }
        }

        public JSONMessageTechnicalLevel TechnicalLevelGetByID(string technicalLevelID)
        {
            JSONMessageTechnicalLevel json = new JSONMessageTechnicalLevel();
            try
            {               
                if (string.IsNullOrEmpty(technicalLevelID))
                {
                    json.ErrorCode = -1;
                    json.ErrorMessage = "Thiếu tham số";
                }

                else
                {
                    technicalLevelBO = new TechnicalLevelBO(DHQGHN.DAL.Common.ConnectionUtil.TKTHDS_TDT_CONNECTION_STRING);
                    TECHNICAL_LEVEL technicalLevel = technicalLevelBO.GetById(technicalLevelID);
                    if (technicalLevel != null)
                    {
                        json.TechnicalLevel.Add(technicalLevel);
                    }                    
                    json.ErrorCode = 200;
                    json.ErrorMessage = "Success";
                }
                json.CurrentTime = DHQGHN.Common.Utils.GetCurrentTimeNow();
                return json;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                throw new FaultException<Fault.UnexpectedServiceFault>(
                    new Fault.UnexpectedServiceFault
                    {
                        ErrorMessage = ex.Message,
                        Source = ex.Source,
                        Target = ex.TargetSite.ToString(),
                        StackTrace = ex.StackTrace
                    },
                    new FaultReason(string.Format("{0}", "Service fault exception")));
            }
        }

        public JSONMessageBloodGroup BloodGroupGetAll()
        {
            try
            {
                JSONMessageBloodGroup json = new JSONMessageBloodGroup();
                bloodGroupBO = new BloodGroupBO(DHQGHN.DAL.Common.ConnectionUtil.TKTHDS_TDT_CONNECTION_STRING);
                json.BloodGroup = bloodGroupBO.GetAll();
                json.ErrorCode = 200;
                json.ErrorMessage = "Success";
                json.CurrentTime = DHQGHN.Common.Utils.GetCurrentTimeNow();
                return json;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                throw new FaultException<Fault.UnexpectedServiceFault>(
                    new Fault.UnexpectedServiceFault
                    {
                        ErrorMessage = ex.Message,
                        Source = ex.Source,
                        Target = ex.TargetSite.ToString(),
                        StackTrace = ex.StackTrace
                    },
                    new FaultReason(string.Format("{0}", "Service fault exception")));
            }
        }

        public JSONMessageBloodGroup BloodGroupGetByID(string bloodGroupID)
        {
            JSONMessageBloodGroup json = new JSONMessageBloodGroup();
            try
            {               
                if (string.IsNullOrEmpty(bloodGroupID))
                {
                    json.ErrorCode = -1;
                    json.ErrorMessage = "Thiếu tham số";
                }
              
                else
                {
                    bloodGroupBO = new BloodGroupBO(DHQGHN.DAL.Common.ConnectionUtil.TKTHDS_TDT_CONNECTION_STRING);
                    BLOOD_GROUP bloodGroup = bloodGroupBO.GetById(bloodGroupID);
                    if (bloodGroup != null)
                    {
                        json.BloodGroup.Add(bloodGroup);
                    }                    
                    json.ErrorCode = 200;
                    json.ErrorMessage = "Success";
                }
                json.CurrentTime = DHQGHN.Common.Utils.GetCurrentTimeNow();
                return json;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                throw new FaultException<Fault.UnexpectedServiceFault>(
                    new Fault.UnexpectedServiceFault
                    {
                        ErrorMessage = ex.Message,
                        Source = ex.Source,
                        Target = ex.TargetSite.ToString(),
                        StackTrace = ex.StackTrace
                    },
                    new FaultReason(string.Format("{0}", "Service fault exception")));
            }
        }

        public JSONMessageSeriousDiseases SeriousDiseasesGetAll()
        {
            try
            {
                JSONMessageSeriousDiseases json = new JSONMessageSeriousDiseases();
                seriousDiseaseBO = new SeriousDiseaseBO(DHQGHN.DAL.Common.ConnectionUtil.TKTHDS_TDT_CONNECTION_STRING);
                json.SeriousDiseases = seriousDiseaseBO.GetAll();
                json.ErrorCode = 200;
                json.ErrorMessage = "Success";
                json.CurrentTime = DHQGHN.Common.Utils.GetCurrentTimeNow();
                return json;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                throw new FaultException<Fault.UnexpectedServiceFault>(
                    new Fault.UnexpectedServiceFault
                    {
                        ErrorMessage = ex.Message,
                        Source = ex.Source,
                        Target = ex.TargetSite.ToString(),
                        StackTrace = ex.StackTrace
                    },
                    new FaultReason(string.Format("{0}", "Service fault exception")));
            }
        }

        public JSONMessageSeriousDiseases SeriousDiseasesGetByID(string seriousDiseasesID)
        {
            JSONMessageSeriousDiseases json = new JSONMessageSeriousDiseases();
            try
            {              
                if (string.IsNullOrEmpty(seriousDiseasesID))
                {
                    json.ErrorCode = -1;
                    json.ErrorMessage = "Thiếu tham số";
                }                
                else
                {
                    seriousDiseaseBO = new SeriousDiseaseBO(DHQGHN.DAL.Common.ConnectionUtil.TKTHDS_TDT_CONNECTION_STRING);
                    SERIOUS_DISEASES serious = seriousDiseaseBO.GetById(seriousDiseasesID);
                    if (serious != null)
                    {
                        json.SeriousDiseases.Add(serious);
                    }                    
                    json.ErrorCode = 200;
                    json.ErrorMessage = "Success";
                }
                json.CurrentTime = DHQGHN.Common.Utils.GetCurrentTimeNow();
                return json;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                throw new FaultException<Fault.UnexpectedServiceFault>(
                    new Fault.UnexpectedServiceFault
                    {
                        ErrorMessage = ex.Message,
                        Source = ex.Source,
                        Target = ex.TargetSite.ToString(),
                        StackTrace = ex.StackTrace
                    },
                    new FaultReason(string.Format("{0}", "Service fault exception")));
            }
        }

        public JSONMessageDisabilityStatus DisabilityStatusGetAll()
        {
            try
            {
                JSONMessageDisabilityStatus json = new JSONMessageDisabilityStatus();
                disabilityStatusBO = new DisabilityStatusBO(DHQGHN.DAL.Common.ConnectionUtil.TKTHDS_TDT_CONNECTION_STRING);
                json.DisabilityStatus = disabilityStatusBO.GetAll();
                json.ErrorCode = 200;
                json.ErrorMessage = "Success";
                json.CurrentTime = DHQGHN.Common.Utils.GetCurrentTimeNow();
                return json;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                throw new FaultException<Fault.UnexpectedServiceFault>(
                    new Fault.UnexpectedServiceFault
                    {
                        ErrorMessage = ex.Message,
                        Source = ex.Source,
                        Target = ex.TargetSite.ToString(),
                        StackTrace = ex.StackTrace
                    },
                    new FaultReason(string.Format("{0}", "Service fault exception")));
            }
        }

        public JSONMessageDisabilityStatus DisabilityStatusGetByID(string disabilityStatusID)
        {
            JSONMessageDisabilityStatus json = new JSONMessageDisabilityStatus();
            try
            {              
                if (string.IsNullOrEmpty(disabilityStatusID))
                {
                    json.ErrorCode = -1;
                    json.ErrorMessage = "Thiếu tham số";
                }               
                else
                {
                    disabilityStatusBO = new DisabilityStatusBO(DHQGHN.DAL.Common.ConnectionUtil.TKTHDS_TDT_CONNECTION_STRING);
                    DISABILITY_STATUS disability = disabilityStatusBO.GetById(disabilityStatusID);
                    if (disability != null)
                    {
                        json.DisabilityStatus.Add(disability);
                    }                    
                    json.ErrorCode = 200;
                    json.ErrorMessage = "Success";
                }
                json.CurrentTime = DHQGHN.Common.Utils.GetCurrentTimeNow();
                return json;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                throw new FaultException<Fault.UnexpectedServiceFault>(
                    new Fault.UnexpectedServiceFault
                    {
                        ErrorMessage = ex.Message,
                        Source = ex.Source,
                        Target = ex.TargetSite.ToString(),
                        StackTrace = ex.StackTrace
                    },
                    new FaultReason(string.Format("{0}", "Service fault exception")));
            }
        }

        public JSONMessageInsuranceStatus InsuranceStatusGetAll()
        {
            try
            {
                JSONMessageInsuranceStatus json = new JSONMessageInsuranceStatus();
                insuranceStatusBO = new InsuranceStatusBO(DHQGHN.DAL.Common.ConnectionUtil.TKTHDS_TDT_CONNECTION_STRING);
                json.InsuranceStatus = insuranceStatusBO.GetAll();
                json.ErrorCode = 200;
                json.ErrorMessage = "Success";
                json.CurrentTime = DHQGHN.Common.Utils.GetCurrentTimeNow();
                return json;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                throw new FaultException<Fault.UnexpectedServiceFault>(
                    new Fault.UnexpectedServiceFault
                    {
                        ErrorMessage = ex.Message,
                        Source = ex.Source,
                        Target = ex.TargetSite.ToString(),
                        StackTrace = ex.StackTrace
                    },
                    new FaultReason(string.Format("{0}", "Service fault exception")));
            }
        }

        public JSONMessageInsuranceStatus InsuranceStatusGetByID(string insuranceStatusID)
        {
            JSONMessageInsuranceStatus json = new JSONMessageInsuranceStatus();
            try
            {              
                if (string.IsNullOrEmpty(insuranceStatusID))
                {
                    json.ErrorCode = -1;
                    json.ErrorMessage = "Thiếu tham số";
                }
                else
                {
                    insuranceStatusBO = new InsuranceStatusBO(DHQGHN.DAL.Common.ConnectionUtil.TKTHDS_TDT_CONNECTION_STRING);
                    INSURANCE_STATUS insurance = insuranceStatusBO.GetById(insuranceStatusID);
                    if (insurance != null)
                    {
                        json.InsuranceStatus.Add(insurance);
                    }                    
                    json.ErrorCode = 200;
                    json.ErrorMessage = "Success";
                }
                json.CurrentTime = DHQGHN.Common.Utils.GetCurrentTimeNow();
                return json;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                throw new FaultException<Fault.UnexpectedServiceFault>(
                    new Fault.UnexpectedServiceFault
                    {
                        ErrorMessage = ex.Message,
                        Source = ex.Source,
                        Target = ex.TargetSite.ToString(),
                        StackTrace = ex.StackTrace
                    },
                    new FaultReason(string.Format("{0}", "Service fault exception")));
            }
        }

        public JSONMessageCourt CourtGetAll()
        {
            try
            {
                JSONMessageCourt json = new JSONMessageCourt();
                courtBO = new CourtBO(DHQGHN.DAL.Common.ConnectionUtil.TKTHDS_TDT_CONNECTION_STRING);
                json.Court = courtBO.GetAll();
                json.ErrorCode = 200;
                json.ErrorMessage = "Success";
                json.CurrentTime = DHQGHN.Common.Utils.GetCurrentTimeNow();
                return json;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                throw new FaultException<Fault.UnexpectedServiceFault>(
                    new Fault.UnexpectedServiceFault
                    {
                        ErrorMessage = ex.Message,
                        Source = ex.Source,
                        Target = ex.TargetSite.ToString(),
                        StackTrace = ex.StackTrace
                    },
                    new FaultReason(string.Format("{0}", "Service fault exception")));
            }
        }

        public JSONMessageCourt CourtGetByID(string courtID)
        {
            JSONMessageCourt json = new JSONMessageCourt();
            try
            {
                if (string.IsNullOrEmpty(courtID))
                {
                    json.ErrorCode = -1;
                    json.ErrorMessage = "Thiếu tham số";
                }
                else
                {
                    courtBO = new CourtBO(DHQGHN.DAL.Common.ConnectionUtil.TKTHDS_TDT_CONNECTION_STRING);
                    COURT court = courtBO.GetById(courtID);
                    if (court != null)
                    {
                        json.Court.Add(court);
                    }
                    json.ErrorCode = 200;
                    json.ErrorMessage = "Success";
                }
                json.CurrentTime = DHQGHN.Common.Utils.GetCurrentTimeNow();
                return json;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                throw new FaultException<Fault.UnexpectedServiceFault>(
                    new Fault.UnexpectedServiceFault
                    {
                        ErrorMessage = ex.Message,
                        Source = ex.Source,
                        Target = ex.TargetSite.ToString(),
                        StackTrace = ex.StackTrace
                    },
                    new FaultReason(string.Format("{0}", "Service fault exception")));
            }
        }

        public JSONMessageDeathCause DeathCauseGetAll()
        {
            try
            {
                JSONMessageDeathCause json = new JSONMessageDeathCause();
                deathCauseBO = new DeathCauseBO(DHQGHN.DAL.Common.ConnectionUtil.TKTHDS_TDT_CONNECTION_STRING);
                json.DeathCause = deathCauseBO.GetAll();
                json.ErrorCode = 200;
                json.ErrorMessage = "Success";
                json.CurrentTime = DHQGHN.Common.Utils.GetCurrentTimeNow();
                return json;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                throw new FaultException<Fault.UnexpectedServiceFault>(
                    new Fault.UnexpectedServiceFault
                    {
                        ErrorMessage = ex.Message,
                        Source = ex.Source,
                        Target = ex.TargetSite.ToString(),
                        StackTrace = ex.StackTrace
                    },
                    new FaultReason(string.Format("{0}", "Service fault exception")));
            }
        }

        public JSONMessageDeathCause DeathCauseGetByID(string deathCauseID)
        {
            JSONMessageDeathCause json = new JSONMessageDeathCause();
            try
            {
                if (string.IsNullOrEmpty(deathCauseID))
                {
                    json.ErrorCode = -1;
                    json.ErrorMessage = "Thiếu tham số";
                }
                else
                {
                    deathCauseBO = new DeathCauseBO(DHQGHN.DAL.Common.ConnectionUtil.TKTHDS_TDT_CONNECTION_STRING);
                    DEATH_CAUSE deathCause = deathCauseBO.GetById(deathCauseID);
                    if (deathCause != null)
                    {
                        json.DeathCause.Add(deathCause);
                    }
                    json.ErrorCode = 200;
                    json.ErrorMessage = "Success";
                }
                json.CurrentTime = DHQGHN.Common.Utils.GetCurrentTimeNow();
                return json;
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToString());
                throw new FaultException<Fault.UnexpectedServiceFault>(
                    new Fault.UnexpectedServiceFault
                    {
                        ErrorMessage = ex.Message,
                        Source = ex.Source,
                        Target = ex.TargetSite.ToString(),
                        StackTrace = ex.StackTrace
                    },
                    new FaultReason(string.Format("{0}", "Service fault exception")));
            }
        }
        #endregion        
    }
}